﻿using System;
using System.Collections.Generic;
using Common;
using System.Data.SqlClient;
using System.Data;

namespace DataAccess
{
    /// <summary>
    /// Summary description for CategoryDAL
    /// </summary>
    public class CategoryDAL : AbstractDataAccess
    {
        public DataTable GetAll()
        {
            return ExecuteQueryAsSqlDataTable(Constant.GetAllCategory, null);
        }

        public bool IsExisted(Guid id)
        {
            return ExecuteQueryAsScalar(Constant.CheckCategory, new List<SqlParameter> { new SqlParameter { ParameterName = "@Id", Value = id } }) != null;
        }
    }
}